/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.ekuma.impexp.processor;

import cn.ekuma.impexp.ImpExpManager;
import cn.ekuma.impexp.ImpExpTableProcessor;
import cn.ekuma.impexp.model.AbstractImpExpTableDefinition;
import cn.ekuma.impexp.model.ImpExpRowDefinition;
import com.openbravo.format.Formats;
/**
 *
 * @author Administrator
 */
public class ExportObjectConverProcessor extends ImpExpTableProcessor{

    public ExportObjectConverProcessor(ImpExpManager manager) {
        super(manager);
    }

    public void process(AbstractImpExpTableDefinition table) {    
           Formats[] fieldFormats=table.getBaseTable().getFieldformat();
           int[] fieldIndex=table.getListFieldIndexs();
           ImpExpRowDefinition row;
           int rowCount=table.getRowCount();
           for(int rowindex=0;rowindex<rowCount;rowindex++){
        	    row=table.getRow(rowindex);
        	    Object[] trusDate=table.getData(rowindex);
                Object[] data1=new Object[trusDate.length];
                for(int i=0;i<fieldIndex.length;i++){
                	int realColumn=fieldIndex[i];
                	data1[i] = fieldFormats[realColumn].formatValue(trusDate[i]);
                }
                row.setDatas(data1);
           }
    }

}
